package com.demo.common.constants;

public class AuthRedisKey {

    /**
     * 授权码模式，用户token的key
     * @param userId 用户id
     * @return key
     */
    public static String authorizationCodeTokenKey(Object userId) {
        return  "service-auth:authorization_code:token:" + userId;
    }

    /**
     * 授权码模式，用户访问接口的key
     * @param userId 用户id
     * @return key
     */
    public static String authorizationCodeUserInterfaceKey(String userId) {
        return "service-auth:authorization_code:interface:" + userId;
    }

    /**
     * 密码授权模式，用户token的key
     * @param userId 用户id
     * @return key
     */
    public static String usernamePasswordTokenKey(Object userId) {
        return "service-auth:usernamepassword:token:" + userId;
    }

    /**
     * 密码授权模式，角色菜单key
     * @param roleId 角色id
     * @return key
     */
    public static String usernamePasswordMenuKey(Object roleId) {
        return "service-auth:usernamepassword:menu:" + roleId;
    }
}
